#ifndef __CONDITION_H_
#define __CONDITION_H_

#include <pthread.h>
#include "Mutex.h"

#include "noncopyable.h"

class Mutex;

namespace BASE{
	class Condition : public noncopyable{
		public:
			Condition();

			virtual ~Condition();

			void notify();

			void notifyAll();

			void wait(Mutex& mutex);

			void wait(Mutex& mutex, int millsec);

		private:
			pthread_cond_t cond;
	};
}

#endif
